/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package br.ufrgs.inf.prav.interop.jsf.components;

import java.io.IOException;
import javax.faces.component.UIComponent;
import javax.faces.component.UIOutput;
import javax.faces.context.FacesContext;

/**
 *
 * @author Fernando
 */
public class VarOutComponent extends UIOutput{

    public static final String COMPONENT_FAMILY = "PRAV_VAROUT";
    public static final String COMPONENT_TYPE = "PRAV_VAROUT";

    private String name, value;

    public VarOutComponent(){
        
    }

    @Override
    public void encodeBegin(FacesContext context) throws IOException {
        context.getExternalContext().getRequestMap().put(name, value);

	}

    @Override
    public void encodeEnd(FacesContext context)
            throws IOException {
    }

    @Override
    public void decode(FacesContext context) {
    }

    // <editor-fold defaultstate="collapsed" desc="Getters and Setters">
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }
    // </editor-fold>


}
